package com.qipay.mapper;

import com.qipay.baas.model.ActionDoc;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.type.JdbcType;

import java.util.List;

@Mapper
public interface ActionDocMapper extends com.qipay.baas.mapper.ActionDocMapper {

    @Select({
            "select",
            "id, title, icon, info, type,order_number  ",
            "from action_doc where `type`=#{type}  order  by  order_number"
    })
    @Results({
            @Result(column="id", property="id", jdbcType= JdbcType.INTEGER, id=true),
            @Result(column="title", property="title", jdbcType=JdbcType.VARCHAR),
            @Result(column="icon", property="icon", jdbcType=JdbcType.VARCHAR),
            @Result(column="info", property="info", jdbcType=JdbcType.VARCHAR),
            @Result(column="type", property="type", jdbcType=JdbcType.TINYINT),
            @Result(column="order_number", property="orderNumber", jdbcType=JdbcType.INTEGER)
    })
    List<ActionDoc> selectByType(byte type);

}
